#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    // char *p = (char *)malloc(20);
    char *p = (char *)calloc(10, 1);
    printf("p = %p\n", p);
    *p = 'h';
    *(p + 1) = 'e';
    *(p + 2) = 'l';
    *(p + 3) = 'l';
    *(p + 4) = 'o';
    printf("p = %s\n", p);

    for (size_t i = 0; i < 10; i++)
    {
        printf("%d-%c\n", *(p + i), *(p + i));
    }
    printf("==================\n");
    memset(p, 'x', 3);

    for (size_t i = 0; i < 10; i++)
    {
        printf("%d-%c\n", *(p + i), *(p + i));
    }
    free(p);
    printf("==================\n");
    char *p1 = (char *)malloc(1024 * 1024 * 1024);
    if (p1 == NULL)
    {
        printf("malloc failed\n");
    }
    free(p1);
}